<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>springboot-thymeleaf demo</title>
</head>

<body>
<p style="color: red" th:text="'hello, ' + ${name} + '!'"/>
<br>
<form th:action="@{/thy/hello}">
    <input type="text" name="username" th:value="${name}">
    <button type="submit">提交</button>
</form>
<!--遍历集合-->
<table>
    <tr>
        <td>ID</td>
        <td>姓名</td>
        <td>年龄</td>
    </tr>
    <tr th:each="user,userState:${list}">
        <td th:text="${user.id}"></td>
        <td th:text="${user.name}"></td>
        <td th:text="${user.age}"></td>
    </tr>
</table>

<hr>
<!--数组-->
<div th:each="a,astate:${str}">
    <div th:text="${a}"></div>
</div>

<hr>
<!--map集合-->
<div th:each="map,mapstate:${map}">
    <div th:text="${map}"></div>
</div>

<hr>
<div th:each="map,mapstate:${map}">
    <i th:text="${mapstate.current.value}"></i>
    <i th:text="${mapstate.current.key}"></i><br>
</div>

</body>
</html>